package pers.cl.dubbo.gateway.selector;

import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;
import pers.cl.dubbo.gateway.GatewayApplication;

/**
 * @author chenlei
 * @date 2020/1/15
 * @description 将GatewayApplication注册到spring ioc容器中
 * @see GatewayApplication
 * @see pers.cl.dubbo.gateway.annotation.EnableMVC
 **/
public class EnableMVCImportRegistrar implements ImportBeanDefinitionRegistrar {
    @Override
    public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry beanDefinitionRegistry) {
        beanDefinitionRegistry.registerBeanDefinition(GatewayApplication.class.getSimpleName(),new RootBeanDefinition(GatewayApplication.class));
    }
}
